Learning Objectives

After completing this lesson, you’ll be able to:

Best Practice

If a workspace runs to completion and produces the output you want, it can’t be wrong, right? Well, yes, it can. It's not enough just to put together a functioning workspace; it's also vital to use FME efficiently and cost-effectively.

In general terms, best practice means the best way of doing something; in other words, carrying out a task effectively and efficiently.

Despite the word 'best,' we're not presuming the ideas here will meet every need and occasion. The best description of this concept I've heard – and one that fits well here – is:

A very good practice to consider in this situation based on experience and analysis.

Why Use Best Practice?

Best practice in FME can help a user to…

Note

I learned about best practices the hard way when I had to work on someone else’s workspaces. My colleague had organized the workspaces so poorly that the operation took me three times as long as it should have!

In this course, we’ll provide a guide to the preferred design for workspaces. The correct style makes a workspace easier to interpret, particularly in the long run when the author might return to it after a period of inactivity.

An FME Workspace Style Guide

“A good-looking, well-organized workspace gives the customer the feeling that you have done quality work.”

Style is the most apparent component of FME Best Practice. You can tell at a glance when a workspace is well-styled and when it is not. As the quote above implies, a well-designed workspace demonstrates competence.

But style is more than looks; an adequately designed workspace provides many benefits as it is further developed and edited in the future.

Good style makes it easier to navigate and understand an existing workspace. Design is essential when workspaces might need to be edited by other users or when you intend to make edits yourself later.

Specifically, a good style can help a user to…

Example of Poor Design

Do you need proof? Well, would you want to be given the task of editing this workspace? Can you even tell what this section does or - more importantly - why?

Messy workspace example

Note

You should always use best practices, whether for a small workspace, training exercise, or a large-scale project. Getting into the habit helps make your smaller projects scalable.

If you don't design a workspace well from the start, it will become harder to make edits as you work on it.

Object Layout

Positioning workspace objects and the care taken in connecting them can make the difference between a poorly designed workspace and one visually attractive and efficient.

Layout methods vary from user to user. Some users like to line up objects so that all connections are horizontal:

Using straight connection lines

Others prefer the tops of objects to be aligned horizontally, with angled connections:

Aligning the top of objects

Some prefer to align object edges vertically:

Aligning the left side of objects

The style is more of a personal preference than a definite rule, but consistency is essential. A workspace with no apparent layout style or an inconsistent one does not inspire confidence in the author's abilities!

Grid and Guides

Grids and Guides are tools to help align workspace objects neatly and tidily. You can access this functionality through View > Grid and Guides on the Workbench menu bar.

Accessing Grids and Guides options

Show Grid displays a grid of lines on the Workbench canvas. Snap to Grid causes all objects – such as the KMLStyler highlighted – to snap onto the intersection of grid lines when moved. In this way, you can more easily line up objects.

Aligning objects using the grid

Show Guides causes guidelines to be displayed on the Workbench canvas whenever an object is moved and lines up approximately to another canvas object. Snap to Guides snaps an object onto a highlighted guideline. Guides are enabled by default.

Aligning objects using guides

These two tools make it very simple to align workspace objects in a pleasing style.

Auto-Layout

The Auto-Layout tool is available on the toolbar of FME Workbench:

Autolayout button on the toolbar

You may need to add the tool to your tool bar. You can add it by right-clicking the toolbar and choosing Customize Toolbar. Then find it under Tools> Apply Auto-Layout. 

Clicking the toolbar button will layout either all of the workspace or just objects that are currently selected:

Autolayout applied to a workspace

As you can see, Auto-Layout tends to use a horizontal pattern, with the tops of objects aligned. Therefore, it's better to select groups of transformers and run the tool on them rather than try to lay out the entire workspace in a single action.